﻿@model BackEnd.Models.AdminActionModel
@{
    ViewBag.Title = "Create action";
}

<h2>Create action</h2>
@using (Html.BeginForm())
{ 
    @Html.ValidationSummary(true, "Action creation was unsuccessful. Please correct the errors and try again.", new { @class="error_box" }) 
                        
    if (ViewData["ErrorMessage"] != null)
    {
    @Html.Label(ViewData["ErrorMessage"].ToString())
    }
    <div>
                   
            <table>
                <tr>
                    <td class="editor-label">
                        @Html.LabelFor(m => m.Code)
                    </td>
                    <td class="editor-field">
                        @Html.TextBoxFor(m => m.Code)
                        @Html.ValidationMessageFor(m => m.Code)
                    </td>
                </tr>

                <tr>
                    <td class="editor-label">
                        @Html.LabelFor(m => m.Name)
                    </td>
                    <td class="editor-field">
                        @Html.TextBoxFor(m => m.Name)
                        @Html.ValidationMessageFor(m => m.Name)
                    </td>
                </tr>
                <tr>
                    <td class="editor-label">
                        @Html.LabelFor(m => m.ActionGroupID)
                    </td>
                    <td class="editor-field">
                        @{var lstActionGroups = ViewData["ListActionGroups"] as System.Collections.IEnumerable;}
                        @Html.DropDownListFor(m => m.ActionGroupID, new SelectList(lstActionGroups, "ActionGroupID", "Code"), "--------", new { id = "ddlActionGroup" })
                        @Html.ValidationMessageFor(m => m.ActionGroupID)
                    </td>
                </tr>

                <tr>
                    <td></td>
                    <td>
                        <img class="NFButtonLeft NFh" src="/Content/Img/0.png"><input id="submit" class="NFButton NFh" type="submit" value="Create" name="submit"><img class="NFButtonRight NFh" src="/Content/Img/0.png">
                        @Html.ActionLink("Back", "Index")
                    </td>
                </tr>
            </table>        
    </div>
} 